import request from '@/config/axios'

export interface SeqConfigVO {
  id: number
  name: string
  prefix: string
  initValue: string
  type: string
  suffix: string
  status: string
  prefixDate: string
  cycleDate: string
  length: number
}

// 查询序号配置分页
export const getSeqConfigPage = async (params) => {
  return await request.get({url: `/system/seq-config/page`, params})
}

// 查询序号配置详情
export const getSeqConfig = async (id: number) => {
  return await request.get({url: `/system/seq-config/get?id=` + id})
}

// 新增序号配置
export const createSeqConfig = async (data: SeqConfigVO) => {
  return await request.post({url: `/system/seq-config/create`, data})
}

// 修改序号配置
export const updateSeqConfig = async (data: SeqConfigVO) => {
  return await request.put({url: `/system/seq-config/update`, data})
}

// 删除序号配置
export const deleteSeqConfig = async (id: number) => {
  return await request.delete({url: `/system/seq-config/delete?id=` + id})
}

// 导出序号配置 Excel
export const exportSeqConfig = async (params) => {
  return await request.download({url: `/system/seq-config/export-excel`, params})
}